<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1.注意一：一旦给const修饰的标识符，标识符被复制之后，不能修改
      // const name = "why";
      // name = "abc"; //Uncaught TypeError: invalid assignment to const 'name'

      //2.注意二：在使用const定义的标识符，必须进行赋值
      // const name; // Uncaught SyntaxError: missing = in const declaration
      //3.注意三：常量的含义是指向的对象不能修改，但是可以改变对象的属性
      // 保存的是对象的内存地址
      const obj = {
        name: "why",
        age: 18,
        height: 1.88,
      };

      console.log(obj); //Object { name: "why", age: 18, height: 1.88 }
      obj.name = "James";
      obj.age = 40;
      obj.height = 2.12;
      console.log(obj); // Object { name: "James", age: 40, height: 2.12 }
    </script>
  </body>
</html>
